// Last Update:2016-11-30 11:04:43

#include <iostream>

#include "xlist.h"

using std::cout;

int main(int argc, const char *argv[])
{
  xlist<int> xi;
  xlist<int>::item xi1(2);
  xlist<int>::item xi2(1);
  xi.push_back(&xi1);
  xi.push_back(&xi2);

  for (xlist<int>::iterator it = xi.begin(); !it.end(); ++it) {
    cout << *it << " ";
  }
  cout << "\n";

  while (!xi.empty()) {
    cout << xi.back() << " ";
    xi.pop_back();
  }
  cout << "\n";

  return 0;
}
